<?php

/**
 * UsuarioTransacao form base class.
 *
 * @package    form
 * @subpackage usuario_transacao
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseUsuarioTransacaoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_usuario_transacao' => new sfWidgetFormInputHidden(),
      'ds_produto'           => new sfWidgetFormInput(),
      'nu_hora_transacao'    => new sfWidgetFormInput(),
      'nu_autorizacao'       => new sfWidgetFormInput(),
      'nu_cv'                => new sfWidgetFormInput(),
      'nu_valor_bruto'       => new sfWidgetFormInput(),
      'nu_valor_final_dia'   => new sfWidgetFormInput(),
      'nu_total_bruto'       => new sfWidgetFormInput(),
      'dt_transacao'         => new sfWidgetFormDate(),
      'nu_total_parcelas'    => new sfWidgetFormInput(),
      'id_dados_usuario'     => new sfWidgetFormDoctrineChoice(array('model' => 'DadosUsuario', 'add_empty' => false)),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_usuario_transacao' => new sfValidatorDoctrineChoice(array('model' => 'UsuarioTransacao', 'column' => 'id_usuario_transacao', 'required' => false)),
      'ds_produto'           => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nu_hora_transacao'    => new sfValidatorInteger(array('required' => false)),
      'nu_autorizacao'       => new sfValidatorInteger(array('required' => false)),
      'nu_cv'                => new sfValidatorInteger(array('required' => false)),
      'nu_valor_bruto'       => new sfValidatorNumber(array('required' => false)),
      'nu_valor_final_dia'   => new sfValidatorNumber(array('required' => false)),
      'nu_total_bruto'       => new sfValidatorNumber(array('required' => false)),
      'dt_transacao'         => new sfValidatorDate(array('required' => false)),
      'nu_total_parcelas'    => new sfValidatorInteger(array('required' => false)),
      'id_dados_usuario'     => new sfValidatorDoctrineChoice(array('model' => 'DadosUsuario')),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'updated_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('usuario_transacao[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'UsuarioTransacao';
  }

}
